package com.snpic.appaw.module.third.api.bjpt.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;

/**
 * @author JiJun
 * @date 2025/9/16 17:28
 * @修改时间 2025/9/16 17:28
 * @description
 */

@Schema(description = "第三方 - 报价平台 请求头对象信息 DTO")
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class CxRequestHeadDto {

	@Schema(description = "客户端流水号", required = true)
	private String clientSeqNo;

	@Schema(description = "系统来源代码，C端专用W151", required = true)
	private String outSystem = "W151";

	@Schema(description = "地区代码")
	private String regionCode;

	@Schema(description = "客户来源代码,如涉及客户来源，必送")
	private String customerSource;

	@Schema(description = "机构代码,10位长度", required = true)
	private String comCode;

	@Schema(description = "操作员工号", required = true)
	private String userCode;

	public Map<String, String> toMap() {
		Map<String, String> map = new HashMap<>();
		if (this.clientSeqNo != null) {
			map.put("clientSeqNo", this.clientSeqNo);
		}
		if (this.outSystem != null) {
			map.put("outSystem", this.outSystem);
		}
		if (this.regionCode != null) {
			map.put("regionCode", this.regionCode);
		}
		if (this.customerSource != null) {
			map.put("customerSource", this.customerSource);
		}
		if (this.comCode != null) {
			map.put("comCode", this.comCode);
		}
		if (this.userCode != null) {
			map.put("userCode", this.userCode);
		}
		return map;
	}
}
